<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>变换的工具条</title>
    <link rel="stylesheet" href="css/font-awesome.min.css">
    <style>
        body{
            background-color: #cccccc;
        }
        .toolbar{
            max-width: 670px;
            min-width: 550px;
            width: 100px;
            margin: 150px auto;
        }
        .button:after{
            content: "+";
        }
        .button{
            background-color: #3AB09E;
            height: 70px;
            width: 70px;
            border-radius: 50%;
            text-align: center;
            color: #ffffff;
            font-size: 3.5em;
            position: relative;
            left: 50%;
            z-index: 1;
            margin-left: -35px;
        }
        .button.active{
            transform: rotate(45deg);
            left: 60px;
        }
        .icons{
            color: #3AB09E;
            width: 0;
            height: 36px;
            list-style: none;
            background-color: #ffffff;
            padding: 17px 10px 17px 50px;
            border-radius: 2em;
            margin: -70px 0 0 45%;
            overflow: hidden;
        }
        .icons.open{
            width: 80%;
            padding: 17px 10px 17px 90px;
            margin: -70px 0 0 5%;
        }
        .icons.open li{
            display: inline-block;
            width: 16%;
        }
        .icons li{
            display: none;
            width: 10%;
        }
        .button,.icons{
            transition:all 1s cubic-bezier(.90, -.40, .20, 2);
        }

       /* .toolbar:hover .icons{
            width: 80%;
            padding: 17px 10px 17px 90px;
            margin: -70px 0 0 5%;
        }
        .toolbar:hover .icons li{
            display: inline-block;
            width: 16%;
        }
        .toolbar:hover .button{
            transform: rotate(45deg);
            left: 60px;
        }*/

    </style>
</head>
<body>
    <div class="toolbar">
        <div class="button"></div>
        <ul class="icons">
            <li class="fa fa-home fa-2x"></li>
            <li class="fa fa-user fa-2x"></li>
            <li class="fa fa-star fa-2x"></li>
            <li class="fa fa-file-text-o fa-2x"></li>
            <li class="fa fa-paper-plane-o fa-2x"></li>
        </ul>
    </div>


    <script src="js/jquery-1.11.0.min.js" type="text/javascript"></script>
    <script type="text/javascript">
        $( ".button" ).click(function() {
            $(this).toggleClass( "active" );
            $(".icons").toggleClass( "open" );
        });
    </script>
</body>
</html>